<h1><%= t(:edit_company) %></h1>

<%= error_messages_for :company %>
<% form_for [:admin, @company] do |f| -%>
  
<p><%= label_tag t(:name) %><br/>
<%= f.text_field :name %></p>

<p><%= submit_tag t(:update_company) %></p>
<% end -%>

<h2><%= t(:company_branch_offices) %></h2>
<ul id="company_branch_offices">
  <% @branch_offices.each do |b| %>
    <%= render :partial => 'branch_office', :locals => { :bo => b } %>
  <% end %>
</ul>
<h3><%= t(:add_new_branch_office) %></h3>
<p class="new-branch-office">
<% remote_form_for [:add_branch_office, :admin, @company] do |f| %>
  <%= text_field :branch_office, :name, :value => t(:name) %>, <%= t(:located_at) %> <%= text_field :branch_office, :city, :value => t(:city) %> <%= submit_tag t(:add_branch_office) %>
<% end %>
</p>

<p class="back"><%= link_to t(:back), admin_companies_path %></p>
